<?php

/**
 * 道具
 *
 * Created by PhpStorm.
 * User: evan
 * Date: 16/9/16
 * Time: 上午2:54
 */
class Props extends MY_Api_Controller
{
    /**
     * 获取
     */
    public function get()
    {
        $uid   = $this->uid;
        $page  = (int)$this->input->get_post('page');
        $limit = (int)$this->input->get_post('limit');


        $this->load->service('direct_seeding/service_direct_seeding_props');
        $data = $this->service_direct_seeding_props->get($uid, $page, $limit);


        $this->json_output($data['data'], $data['status']);
    }


    /**
     * 使用
     */
    public function apply()
    {
        $uid    = $this->uid;
        $pid    = (int)$this->input->get_post('pid');
        $number = (int)$this->input->get_post('number');
        $ds_id  = (int)$this->input->get_post('ds_id');


        $this->load->service('direct_seeding/service_direct_seeding_props');
        $data = $this->service_direct_seeding_props->apply($uid, $pid, $number, $ds_id);


        $this->json_output($data['data'], $data['status']);
    }
}